﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildPlannerLib.SimEvents
{
    // Derived class from Event for a worker returning gas
    public class ReturnGas : SimEvent
    {
        // Field for the base at which mining is taking place
        public Base AtBase;

        // Field for the per-trip yield of the gas geyser
        public int Yield;

        // Constructor with parameters for parent build, gas yield and time
        public ReturnGas(Build build, Base b, int yield, int time)
        {
            Build = build;
            AtBase = b;
            Yield = yield;
            Time = time;
        }

        // Adds minerals from the return and adds an event for the worker reaching the gas geyser
        public override void Execute()
        {
            Build.Player.Gas.Change(Yield);

            int newTime = Time;
            AtBase.GasWorkerStatus[0]++;
            newTime += 211;
            Build.EventList.Add(new ReachGasGeysers(Build, AtBase, newTime));
        }
    }
}
